<script setup lang="ts">
import axios from "axios";
import { ref, onMounted } from "vue";

let data = ref("");

const getData = async () => {
  const response = await axios.get(
    "https://api.uomg.com/api/rand.qinghua?format=json"
  );
  //console.log(response.data, 2222);
  data.value = response.data.content;
  console.log(data);
};

onMounted(() => {
  getData();
});
</script>
<template>
  <h3>Data: {{ data }}</h3>
  <br />

  <button class="btn btn-default" @click="getData">Get Data</button>
</template>


<style scoped>
h3 {
  text-shadow: 2px 2px #eee;
}
</style>